<template>
  <div class="home">
    <h1 @click="change">Home</h1>
    <p>{{msg}}</p>
  </div>
</template>

<script type="text/ecmascript-6">
  import About from './About.vue'
  import axios from 'axios'

  export default {
    components: {
      About
    },
    data () {
      return {
        msg: 'Hello, vue router!'
      }
    },
    methods: {
      change () {
        let query = {
          method: 'GET',
          path: '/access_token',
          data: {}
        }
        axios.post('/dispatcher', query).then((resp) => {
          this.msg = JSON.stringify(resp)
        })
        // this.msg = 'nihao'
      }
    }
  }
</script>
